package com.tasks.server;

import org.apache.log4j.Logger;

public class ServerException extends Exception {

	private static final long serialVersionUID = 1L;
	
	static Logger logger = Logger.getLogger(ServerException.class);
	
	public ServerException(String s) 
	{
		super(s);
		logger.error(s);
	}
	
	public ServerException(Throwable e)
	{
		super(e);
		logger.error(e.toString());
	}
	
	public ServerException(String s, Throwable e)
	{
		super(s,e);
		logger.error(s, e);
	}
	
	public ServerException(Object cls, String method, String s)
	{
		super(s);
		logger.error(cls.getClass().getCanonicalName() + "." + method + ": "  + s);
	}
	
	public ServerException(Object cls, String method, Throwable e)
	{
		super(e);
		logger.error(cls.getClass().getCanonicalName() + "." + method + ": "  + e.toString());
	}
}
